package com.pan.controller.Notices;

import com.pan.aop.BusinessType;
import com.pan.aop.MyLog;
import com.pan.controller.tools.R1;
import com.pan.service.INoticeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lastnotice")
@Tag(name = "LastNoticeController",description = "获取最新的公告")
public class LastNoticeController {
    @Autowired
    private INoticeService noticeService;

    //获取最新公告
    @Operation(summary = "获取最新的公告")
    @GetMapping
    @MyLog(title = "获取最新公告",optParam = "无",businessType = BusinessType.SELECT)
    public R1 getLastNotice(){
        return new R1(true,noticeService.getLastNotice());
    }
}
